package com.fight.strive.sys.modules.rbac.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fight.strive.sys.modules.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * 用户-角色关联表
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Entity
@Table(name = "t_sys_rbac_department_role",
        uniqueConstraints = {@UniqueConstraint(columnNames = {"departmentId", "roleId"})},
        indexes = {
                @Index(columnList = "departmentId"),
                @Index(columnList = "roleId")})
@TableName("t_sys_rbac_department_role")
public class RbacDepartmentRoleEntity extends BaseEntity {

    /**
     * 部门ID
     */
    private Long departmentId;

    /**
     * 角色ID
     */
    private Long roleId;
}
